#include "obs-context-wrapper.h"
#include <obs.h>
#include <iostream>

int main()
{
    std::cout << "Testing OBS Context Wrapper..." << std::endl;
    
    // 测试自动初始化
    {
        std::cout << "Testing auto-initialization..." << std::endl;
        OBSContextWrapper context("en-US", nullptr, nullptr, true);
        
        if (context.IsValid()) {
            std::cout << "✓ Auto-initialization successful" << std::endl;
        } else {
            std::cout << "✗ Auto-initialization failed" << std::endl;
            return -1;
        }
        
        if (context.IsInitialized()) {
            std::cout << "✓ OBS is initialized" << std::endl;
        } else {
            std::cout << "✗ OBS is not initialized" << std::endl;
            return -1;
        }
    }
    
    // 测试手动初始化
    {
        std::cout << "Testing manual initialization..." << std::endl;
        OBSContextWrapper context("en-US", nullptr, nullptr, false);
        
        if (!context.IsValid()) {
            std::cout << "✓ Context not initialized (as expected)" << std::endl;
        } else {
            std::cout << "✗ Context should not be initialized" << std::endl;
            return -1;
        }
        
        if (context.Initialize()) {
            std::cout << "✓ Manual initialization successful" << std::endl;
        } else {
            std::cout << "✗ Manual initialization failed" << std::endl;
            return -1;
        }
        
        if (context.IsValid()) {
            std::cout << "✓ Context is now valid" << std::endl;
        } else {
            std::cout << "✗ Context should be valid after initialization" << std::endl;
            return -1;
        }
    }
    
    std::cout << "All tests passed!" << std::endl;
    return 0;
} 